package com.fezs.common.exception;

import com.fezs.common.constants.ErrorCode;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

/**
 * 请求参数异常
 *
 * @author zhukai
 * @since 2022/8/18
 */
@Getter
@Setter
@ToString
public class ArgumentException extends RuntimeException {

    /**
     * 业务错误码
     */
    private String code;

    /**
     * 错误提示
     */
    private String message;

    public ArgumentException() {}

    public ArgumentException(String message) {
        this.code = ErrorCode.BAD_REQUEST.getCode();
        this.message = message;
    }

    public ArgumentException(String code, String message) {
        this.code = code;
        this.message = message;
    }

}
